# coding:utf-8
from flask_wtf import FlaskForm
from sqlalchemy import func
from wtforms import StringField, SubmitField
from wtforms.validators import DataRequired

from faces import db


class UserInfo(db.Model):
    __tablename__ = 'user'
    userid = db.Column(db.String(20),primary_key=True)
    username = db.Column(db.String(30), unique=True)
    userphoto = db.Column(db.LargeBinary)
    # 删除标记
    isDelete = db.Column(db.Boolean(),default=False)



class UserKaoqin(db.Model):
    __tablename__ = 'userkq'

    user_id = db.Column(db.String(20),primary_key=True)
    user_name = db.Column(db.String(30), unique=True)

    kqdate  = db.Column(db.DateTime, server_default=func.now())



# 自定义表单类
class UserForm(FlaskForm):
    userid = StringField('工号：', validators=[DataRequired()])
    username = StringField('姓名：')
    submit = SubmitField('提交')



